package com.xxxy.dongyexuan.mapper;

import com.xxxy.dongyexuan.po.Flow;
import com.xxxy.dongyexuan.po.Level;
import org.apache.ibatis.annotations.*;
import org.mybatis.spring.annotation.MapperScan;

import java.util.List;

@MapperScan("com.xxxy.dongyexuan.demobeautyhaird.mapper")
public interface IFlowMapper{
        @Select("select count(*) from flow")
        public int getcount();

        @Select("SELECT * FROM flow WHERE fid = #{fid}")
        public Flow findById(@Param("fid") int fid);

        @Select("SELECT * FROM flow")
        public List<Flow> findAll();

        @Insert("INSERT flow VALUES (#{fid}, #{cid},#{ftype},#{ftime},#{fmoney},#{ftotalmoney})")
        public int save(Flow flow);

        @Update("UPDATE flow SET cid = #{cid},ftype = #{ftype},ftime = #{ftime},fmoney = #{fmoney},ftotalmoney = #{ftotalmoney} WHERE fid = #{fid}")
        public int merge(Flow flow);

        @Delete("DELETE FROM flow WHERE fid = #{fid}")
        public int delete(@Param("fid") int fid);
        @Select("select * from flow limit #{from},#{pagesize}")
        public List<Flow> findByPage(@Param("from") int from, @Param("pagesize") int pagesize);}
